package com.sixth.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sixth.dao.StaffDao;
import com.sixth.dao.StafftransferDao;
import com.sixth.entity.Staff;
import com.sixth.entity.Stafftransfer;
import com.sixth.service.OutitStaffService;
import com.sixth.util.TableLayUi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: project01
 * @description:
 * @author: 高振杨
 * @create: 2021-12-18 15:14
 **/
@Service(value = "/outitstaffService")
public class OutitStaffServiceImpl implements OutitStaffService {
    @Autowired
    private StaffDao dao;
    public TableLayUi findStaffBycondition(int page, int limit, String staffname, Integer staffid) {
        PageHelper.startPage(page,limit);
        List<Staff> Staff= dao.selectStaffBystate(staffname,staffid);

        PageInfo<Staff> pageInfo = new PageInfo<Staff>(Staff);
        //pageInfo.getTotal:获取的为表中总条数
        //pageInfo.getList():获取的为当前页的记录数据
        return new TableLayUi(0,"",pageInfo.getTotal(),pageInfo.getList());
    }
}
